package com.bms.hystrix.interfaces.lts;


import com.bms.hystrix.pojo.ShiPinBiao;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.util.Map;

/**
 * @author thinknovo
 * @version 1.0
 * @description ServiceFeignByCheck.java
 * @date 2021/3/11 9:23
 */
// 此接口与feign中定义的接口一样，直接迁移过来即可
// 调用一个子服务模块，需要在注解中指定，名字由client的yml文件定义
@FeignClient(value = "SHIPINGCLIENT")
public interface ServiceFeignByCheck {

    /*
    这里需要几个要点：
    1.这里定义的路径作用是调用client中的接口
    2.这里的method即是只定义了get，在feign还是会检查client是否允许post请求，如果没有post请求将报错
    3.@RequestParam(value = "name")是绑定controller中的形式参数名，如果没有value属性定义也会报错
     */
    @RequestMapping(value = "/shiPinBiao/chaXunFenYe",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map chaXunFenYe(@RequestParam(name = "page") int page, @RequestParam(name = "mingCheng") String mingCheng);


    @RequestMapping(value = "/shiPinBiao/shanChuById",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map shanChuById(@RequestParam("id") String id);

    @RequestMapping(value = "/shiPinBiao/gengXinById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     Map gengXinById(@RequestBody @ApiParam(name = "shiPinBiao", value = "pojo模型", required = true) ShiPinBiao shiPinBiao);

    @RequestMapping(value = "/shiPinBiao/xinZeng",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
      Map xinZeng(@RequestBody ShiPinBiao shiPinBiao) throws FileNotFoundException;

    @RequestMapping(value = "/shiPinBiao/taoLunLiangById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
      Map taoLunLiangById(@RequestBody @ApiParam(name = "shiPinBiao", value = "pojo模型", required = true) ShiPinBiao shiPinBiao);


    @RequestMapping(value = "/shiPinBiao/xiaZaiLiangById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
      Map xiaZaiLiangById(@RequestBody @ApiParam(name = "shiPinBiao", value = "pojo模型", required = true) ShiPinBiao shiPinBiao);

    @RequestMapping(value = "/shiPinBiao/boFangLiangById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map boFangLiangById(@RequestBody @ApiParam(name = "shiPinBiao", value = "pojo模型", required = true) ShiPinBiao shiPinBiao);

    @RequestMapping(value = "/shiPinBiao/xiaZaiLiangById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map xiaZaiShiPin(@RequestBody String diZhi);

}
